package br.org.blacklist.web;

import br.org.blacklist.core.jdo.repository.IBlacklistRepository;
import br.org.blacklist.core.pmf.PersistenceManagerFilter;
import br.org.blacklist.model.governamental.Instituicao;
import br.org.blacklist.service.governamental.InstituicaoQuery;
import br.org.blacklist.service.governamental.InstituicaoQueryInterface;
import br.org.blacklist.service.governamental.InstituicaoRepository;

import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;

/**
 * This Guice module sets up the bindings used in this Wicket application, including the JDO PersistenceManager.
 */
public class BlacklistPoliticoGuiceModule extends AbstractModule {

    @Override
    protected void configure() {
        // Enable per-request-thread PersistenceManager injection.
        install(new PersistenceManagerFilter.GuiceModule());

        // Business object bindings go here.
        bind(InstituicaoQueryInterface.class).to(InstituicaoQuery.class);
        bind(new TypeLiteral<IBlacklistRepository<Instituicao>>() {}).to(InstituicaoRepository.class);
    }
}
